Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting sanity hostname attr initially #15350

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

jyejare
Copy link
Member

@jyejare jyejare commented Jun 6, 2024

Problem Statement

Sanity is failing with server.hostname attribute not found. Earlier the dynaconf validator was setting it as a default value and attribute but that Is removed in PR #15340.

Solution

Setting the hostname attribute to server for sanity.

Local Testing

In [2]: settings.server.hostname
---------------------------------------------------------------------------
BoxKeyError                               Traceback (most recent call last)
Cell In[2], line 1
----> 1 settings.server.hostname

File ~/venv/robottelo312/src/dynaconf/dynaconf/utils/boxing.py:18, in evaluate_lazy_format.<locals>.evaluate(dynabox, item, *args, **kwargs)
     16 @wraps(f)
     17 def evaluate(dynabox, item, *args, **kwargs):
---> 18     value = f(dynabox, item, *args, **kwargs)
     19     settings = dynabox._box_config["box_settings"]
     21     if getattr(value, "_dynaconf_lazy_format", None):

File ~/venv/robottelo312/src/dynaconf/dynaconf/utils/boxing.py:41, in DynaBox.__getattr__(self, item, *args, **kwargs)
     39 except (AttributeError, KeyError):
     40     n_item = find_the_correct_casing(item, self) or item
---> 41     return super().__getattr__(n_item, *args, **kwargs)

File ~/venv/robottelo312/src/dynaconf/dynaconf/vendor/box/box.py:360, in Box.__getattr__(self, item)
    358     if self._box_config['default_box']:
    359         return self.__get_default(item)
--> 360     raise BoxKeyError(str(err)) from None
    361 return value

BoxKeyError: "'DynaBox' object has no attribute 'hostname'"

In [3]: settings.set("server.hostname", None)

In [4]: type(settings.server.hostname)
NoneType

@jyejare jyejare requested a review from a team as a code owner June 6, 2024 16:15
@jyejare jyejare added CherryPick PR needs CherryPick to previous branches 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Jun 6, 2024
@jyejare
Copy link
Member Author

jyejare commented Jun 6, 2024

trigger: test-robottelo
pytest: tests/foreman -m build_sanity -k test_satellite_installation

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7312
Build Status: SUCCESS
PRT Comment: pytest tests/foreman -m build_sanity -k test_satellite_installation --external-logging
Test Result : ======== 1 passed, 5513 deselected, 5521 warnings in 1161.53s (0:19:21) ========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jun 6, 2024
@omkarkhatavkar omkarkhatavkar merged commit 956ccf2 into SatelliteQE:master Jun 6, 2024
12 of 13 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 6, 2024
github-actions bot pushed a commit that referenced this pull request Jun 6, 2024
github-actions bot pushed a commit that referenced this pull request Jun 6, 2024
jyejare added a commit that referenced this pull request Jun 6, 2024
Setting sanity hostname attr initially (#15350)

(cherry picked from commit 956ccf2)

Co-authored-by: Jitendra Yejare <[email protected]>
jyejare added a commit that referenced this pull request Jun 6, 2024
Setting sanity hostname attr initially (#15350)

(cherry picked from commit 956ccf2)

Co-authored-by: Jitendra Yejare <[email protected]>
jyejare added a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants